﻿using ConfExpert.Forms.Base;
using DevTeam;
using System;
using System.Data;

namespace ConfExpert.Forms.SatinAlma.YeniYapi.Confirmation
{
    public partial class CheckBitenYukleme : XForm
    {
        DataTable t;
        public CheckBitenYukleme(DataTable t)
        {
            InitializeComponent();
            this.t = t;
            this.Text = "Devamı Gelecek Artikeller";
        }

        private void CheckBitenYukleme_Load(object sender, EventArgs e)
        {
            gridView1.Init(t);
            gridView1.FormatAsPercentage("KalanOran");
            gridView1.FormatAsNumber(1, "SipMt", "KonfMt", "YuklenenMt", "KalanYukleme");
            gridView1.AddSummary("SipMt", "KonfMt", "YuklenenMt", "KalanYukleme");
            gridView1.AddColumn("DevamiGelecekMi", typeof(bool));

            btnKaydet.ItemClick += btnKaydet_ItemClick;
            gridView1.BestFitColumns();
        }

        void btnKaydet_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            gridView1.EndEditing();
            ExecuteNonQuery("UpdBitenYukleme", gridView1.Serialize());
            this.DialogResult = System.Windows.Forms.DialogResult.OK;
        }
    }
}
